.class public final Lcom/farmis/feedme/api/ApiClient;
.super Ljava/lang/Object;
.source "ApiClient.kt"


# instance fields
.field private final TAG:Ljava/lang/String;

.field private final retrofit:Lretrofit2/Retrofit;

.field private final reviewApi:Lcom/farmis/feedme/api/services/FeedBackApi;


# direct methods
.method public constructor <init>()V
    .locals 2

    .line 22
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-string v0, "ApiClient"

    .line 23
    iput-object v0, p0, Lcom/farmis/feedme/api/ApiClient;->TAG:Ljava/lang/String;

    .line 25
    new-instance v0, Lretrofit2/Retrofit$Builder;

    invoke-direct {v0}, Lretrofit2/Retrofit$Builder;-><init>()V

    .line 26
    sget-object v1, Lcom/farmis/feedme/Conf;->Companion:Lcom/farmis/feedme/Conf$Companion;

    invoke-virtual {v1}, Lcom/farmis/feedme/Conf$Companion;->getIns()Lcom/farmis/feedme/Conf;

    move-result-object v1

    invoke-virtual {v1}, Lcom/farmis/feedme/Conf;->getApiUrl()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lretrofit2/Retrofit$Builder;->baseUrl(Ljava/lang/String;)Lretrofit2/Retrofit$Builder;

    .line 27
    invoke-static {}, Lretrofit2/converter/moshi/MoshiConverterFactory;->create()Lretrofit2/converter/moshi/MoshiConverterFactory;

    move-result-object v1

    invoke-virtual {v0, v1}, Lretrofit2/Retrofit$Builder;->addConverterFactory(Lretrofit2/Converter$Factory;)Lretrofit2/Retrofit$Builder;

    .line 28
    invoke-virtual {v0}, Lretrofit2/Retrofit$Builder;->build()Lretrofit2/Retrofit;

    move-result-object v0

    const-string v1, "Retrofit.Builder()\n     \u2026e())\n            .build()"

    invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    iput-object v0, p0, Lcom/farmis/feedme/api/ApiClient;->retrofit:Lretrofit2/Retrofit;

    .line 33
    iget-object v0, p0, Lcom/farmis/feedme/api/ApiClient;->retrofit:Lretrofit2/Retrofit;

    const-class v1, Lcom/farmis/feedme/api/services/FeedBackApi;

    invoke-virtual {v0, v1}, Lretrofit2/Retrofit;->create(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    const-string v1, "retrofit.create(FeedBackApi::class.java)"

    invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    check-cast v0, Lcom/farmis/feedme/api/services/FeedBackApi;

    iput-object v0, p0, Lcom/farmis/feedme/api/ApiClient;->reviewApi:Lcom/farmis/feedme/api/services/FeedBackApi;

    return-void
.end method


# virtual methods
.method public final getTAG()Ljava/lang/String;
    .locals 1

    .line 23
    iget-object v0, p0, Lcom/farmis/feedme/api/ApiClient;->TAG:Ljava/lang/String;

    return-object v0
.end method

.method public final postFeedBack(Landroid/content/Context;Landroid/os/Bundle;Ljava/lang/String;Ljava/lang/String;)V
    .locals 8

    const-string v0, "context"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "bundle"

    invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "oneSignalId"

    invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "appVersion"

    invoke-static {p4, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const/4 v6, 0x0

    const/4 v7, 0x0

    move-object v1, p0

    move-object v2, p1

    move-object v3, p2

    move-object v4, p3

    move-object v5, p4

    .line 37
    invoke-virtual/range {v1 .. v7}, Lcom/farmis/feedme/api/ApiClient;->postFeedBack(Landroid/content/Context;Landroid/os/Bundle;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V

    return-void
.end method

.method public final postFeedBack(Landroid/content/Context;Landroid/os/Bundle;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
    .locals 16
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Landroid/os/Bundle;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Lkotlin/jvm/functions/Function1<",
            "-",
            "Lokhttp3/ResponseBody;",
            "Lkotlin/Unit;",
            ">;",
            "Lkotlin/jvm/functions/Function1<",
            "-",
            "Ljava/lang/String;",
            "Lkotlin/Unit;",
            ">;)V"
        }
    .end annotation

    move-object/from16 v0, p1

    move-object/from16 v1, p2

    const-string v2, "context"

    invoke-static {v0, v2}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v2, "bundle"

    invoke-static {v1, v2}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v2, "oneSignalId"

    move-object/from16 v12, p3

    invoke-static {v12, v2}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v2, "appVersion"

    move-object/from16 v11, p4

    invoke-static {v11, v2}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 41
    new-instance v2, Lcom/farmis/feedme/api/models/FeedbackModel;

    .line 42
    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;

    move-result-object v3

    iget-object v13, v3, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;

    const-string v3, "context.applicationInfo.packageName"

    invoke-static {v13, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 43
    sget-object v3, Lcom/farmis/feedme/FeedMe;->BUNDLE_FEEDBACK:Ljava/lang/String;

    invoke-virtual {v1, v3}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v3, "bundle.getString(FeedMe.BUNDLE_FEEDBACK)"

    invoke-static {v1, v3}, Lkotlin/jvm/internal/Intrinsics;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 44
    sget-object v3, Lcom/farmis/feedme/Conf;->Companion:Lcom/farmis/feedme/Conf$Companion;

    invoke-virtual {v3}, Lcom/farmis/feedme/Conf$Companion;->getIns()Lcom/farmis/feedme/Conf;

    move-result-object v3

    invoke-virtual {v3}, Lcom/farmis/feedme/Conf;->getQuestion()Ljava/lang/String;

    move-result-object v14

    .line 45
    new-instance v15, Lcom/farmis/feedme/api/models/UserModel;

    sget-object v3, Lcom/farmis/feedme/utils/DeviceInfoUtils;->INSTANCE:Lcom/farmis/feedme/utils/DeviceInfoUtils;

    invoke-virtual {v3, v0}, Lcom/farmis/feedme/utils/DeviceInfoUtils;->getGoogleEmail(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v4

    .line 46
    sget-object v3, Lcom/farmis/feedme/utils/DeviceInfoUtils;->INSTANCE:Lcom/farmis/feedme/utils/DeviceInfoUtils;

    invoke-virtual {v3, v0}, Lcom/farmis/feedme/utils/DeviceInfoUtils;->getDeviceID(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v5

    .line 47
    sget-object v0, Lcom/farmis/feedme/utils/DeviceInfoUtils;->INSTANCE:Lcom/farmis/feedme/utils/DeviceInfoUtils;

    invoke-virtual {v0}, Lcom/farmis/feedme/utils/DeviceInfoUtils;->getDeviceLanguage()Ljava/lang/String;

    move-result-object v6

    .line 48
    sget-object v0, Lcom/farmis/feedme/utils/DeviceInfoUtils;->INSTANCE:Lcom/farmis/feedme/utils/DeviceInfoUtils;

    invoke-virtual {v0}, Lcom/farmis/feedme/utils/DeviceInfoUtils;->getDeviceCountry()Ljava/lang/String;

    move-result-object v7

    .line 49
    sget-object v0, Lcom/farmis/feedme/utils/DeviceInfoUtils;->INSTANCE:Lcom/farmis/feedme/utils/DeviceInfoUtils;

    invoke-virtual {v0}, Lcom/farmis/feedme/utils/DeviceInfoUtils;->getDeviceManufacturer()Ljava/lang/String;

    move-result-object v8

    .line 50
    sget-object v0, Lcom/farmis/feedme/utils/DeviceInfoUtils;->INSTANCE:Lcom/farmis/feedme/utils/DeviceInfoUtils;

    invoke-virtual {v0}, Lcom/farmis/feedme/utils/DeviceInfoUtils;->getDeviceModel()Ljava/lang/String;

    move-result-object v9

    .line 51
    sget-object v0, Lcom/farmis/feedme/utils/DeviceInfoUtils;->INSTANCE:Lcom/farmis/feedme/utils/DeviceInfoUtils;

    invoke-virtual {v0}, Lcom/farmis/feedme/utils/DeviceInfoUtils;->getDeviceOS()Ljava/lang/String;

    move-result-object v10

    move-object v3, v15

    .line 45
    invoke-direct/range {v3 .. v12}, Lcom/farmis/feedme/api/models/UserModel;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 41
    invoke-direct {v2, v13, v14, v1, v15}, Lcom/farmis/feedme/api/models/FeedbackModel;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/farmis/feedme/api/models/UserModel;)V

    move-object/from16 v0, p0

    move-object/from16 v1, p5

    move-object/from16 v3, p6

    .line 55
    invoke-virtual {v0, v2, v1, v3}, Lcom/farmis/feedme/api/ApiClient;->postFeedBack(Lcom/farmis/feedme/api/models/FeedbackModel;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V

    return-void
.end method

.method public final postFeedBack(Lcom/farmis/feedme/api/models/FeedbackModel;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/farmis/feedme/api/models/FeedbackModel;",
            "Lkotlin/jvm/functions/Function1<",
            "-",
            "Lokhttp3/ResponseBody;",
            "Lkotlin/Unit;",
            ">;",
            "Lkotlin/jvm/functions/Function1<",
            "-",
            "Ljava/lang/String;",
            "Lkotlin/Unit;",
            ">;)V"
        }
    .end annotation

    const-string v0, "model"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 63
    iget-object v0, p0, Lcom/farmis/feedme/api/ApiClient;->reviewApi:Lcom/farmis/feedme/api/services/FeedBackApi;

    invoke-interface {v0, p1}, Lcom/farmis/feedme/api/services/FeedBackApi;->postFeedback(Lcom/farmis/feedme/api/models/FeedbackModel;)Lretrofit2/Call;

    move-result-object p1

    new-instance v0, Lcom/farmis/feedme/api/ApiClient$postFeedBack$1;

    invoke-direct {v0, p0, p3, p2}, Lcom/farmis/feedme/api/ApiClient$postFeedBack$1;-><init>(Lcom/farmis/feedme/api/ApiClient;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V

    invoke-interface {p1, v0}, Lretrofit2/Call;->enqueue(Lretrofit2/Callback;)V

    return-void
.end method
